<%--
  Created by IntelliJ IDEA.
  User: LJS
  Date: 2018/11/15
  Time: 13:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page trimDirectiveWhitespaces="true"%>
<%@page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName()
            + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>考勤管理</title>
    <jsp:include page="resource.jsp"/>
    <script type="text/javascript">
        //updateSign
        function updateSign(){

            $.ajax({
                url:"${pageContext.request.contextPath}/sign/update.do",
                type:"post",
                async:false,
                data:{},
                dataType: 'json',
                success:function(data){

                    if(data.res.trim() === "1" ) {
                        window.location.reload();
                    }else{
                        //...
                    }
                }
            })
        }
    </script>
</head>
<body>
<jsp:include page="common.jsp"/>

<!-- Start #content -->
<div id="content">
    <!-- Start .content-wrapper -->
    <div class="content-wrapper">
        <!-- Start .row -->
        <div class="row">
            <!-- Start .page-header -->
            <div class="col-lg-12 heading">
                <h1 class="page-header"><i class="im-signup"></i> 考勤管理</h1>
            </div>
            <!-- End .page-header -->
        </div>
        <!-- End .row -->
        <!-- Start .outlet -->
        <div class="outlet">
            <!-- Page start here ( usual with .row ) -->
            <div class="row printable">
                <!-- col-lg-12 start here -->
                <div class="col-lg-12">
                    <!-- Start .panel -->
                    <div class="panel panel-default plain">
                        <div class="panel-heading white-bg"></div>
                        <div class="panel-body">
                            <!-- Start .invoice -->
                            <div class="invoice">
                                <!-- Start .invoice-header -->
                                <div class="invoice-header">
                                    <%--<h3 class="text-center">
                                        本月天数：<span class="text-primary">XX天</span>
                                    </h3>
                                    <div class="">
                                        <div class="pull-left col-sm-4 text-center">
                                            已签到数：<span class="text-success">XX条</span>
                                        </div>
                                        <div class="pull-left col-sm-4 text-center">
                                            未签到数：<span class="text-warning">XX条</span>
                                        </div>
                                        <div class="clearfix"></div>
                                    </div>
                                    <hr/>--%>
                                    <jsp:useBean id="signTable" class="net.office.utils.SignBean" scope="session" />
                                    <jsp:setProperty name="signTable" property="year" value="${year}"/>
                                    <jsp:setProperty name="signTable" property="month" value="${month}"/>
                                    <jsp:setProperty name="signTable" property="signInList" value="${signInList}"/>
                                    <%--<form action="" method="get" class="form-horizontal" role="form">
                                        <div class="form-group col-md-6">
                                            <label for="year" class="col-md-4 control-label">年：</label>
                                            <div class="col-md-8">
                                                <input type="text" class="form-control" id="year" name="year">
                                            </div>
                                        </div>
                                        <div class="form-group col-md-6">
                                            <label for="month" class="col-md-4 control-label">月：</label>
                                            <div class="col-md-8">
                                                <select class="form-control" id="month" name="month">
                                                    <option value="">--请选择--</option>
                                                    <c:forEach var="x" begin="1" end="12">
                                                        <option value="${x }" >${x}</option>
                                                    </c:forEach>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <input type="submit" class="form-control btn btn-primary" value="搜索" />
                                        </div>
                                    </form>--%>
                                </div>
                                <!-- End .invoice-header -->

                                <!-- Start .invoice-content -->
                                <div class="invoice-content">
                                    <a href="javascript:void(0)" class="btn btn-primary mb5" onclick="updateSign()">签到</a>

                                    <span class="color-blue pull-right mt15">
                                        <jsp:getProperty name="signTable" property="year"/>年
                                        <jsp:getProperty name="signTable" property="month"/>月
                                    </span>
                                    <jsp:getProperty name="signTable" property="calendar" />
                                </div>
                            </div>
                            <!-- End .invoice -->
                        </div>
                    </div>
                    <!-- End .panel -->
                </div>
                <!-- col-lg-12 end here -->
            </div>
            <!-- Page End here -->
        </div>
        <!-- End .outlet -->
    </div>
    <!-- End .content-wrapper -->
    <div class="clearfix"></div>
</div>
<!-- End #content -->
</body>
</html>
